package cn.com.api.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import cn.com.api.entity.ApiDianPing;
import cn.com.api.entity.ApiDingDan;
import cn.com.api.entity.Cond;
import cn.com.api.requestpage.CancelReasonPage;
import cn.com.api.requestpage.OrderConfirmPage;
import cn.com.api.requestpage.SearchOrdersPage;
import cn.com.api.requestpage.SendOrderPage;
import cn.com.api.requestpage.ShopOrderPage;
import cn.com.api.resultpage.AccountPage;
import cn.com.api.resultpage.InitOrderInfoPage;
import cn.com.api.resultpage.InitOrderPage;
import cn.com.util.*;

@Service
public interface ApiOrderService {
	/** 根据购物车记录-查询 */
	public InitOrderPage getShopListByCids(String c_ids);

	/** 根据货品product_ids记录-查询 */
	public InitOrderPage getProductListByproductids(String product_ids);

	/** 根据积分活动act_ids记录-查询 */
	public InitOrderPage getProductListByactids(String act_ids);

	public void initOrder(String u_id, String c_ids, Map<String, Object> map);

	public void confirmOrder(OrderConfirmPage orderConfirmPage, Map<String, Object> map) throws Exception;

	/**
	 * 后台根据不同的状态搜索订单
	 * 
	 * @param conditions
	 * @param pageInfo
	 *            分类状态
	 * @return
	 */
	public List<Map<String, Object>> searchOrder(Map<String, Object> conditions, PageInfo pageInfo);

	/** 账户中心 */
	public void getChargeCondition(Map<String, String> params, Map<String, Object> map) throws Exception;

	/** 我的订单 */
	public void getMyOrders(Map<String, String> params, Map<String, Object> map, PageInfo page) throws Exception;

	/** 待评价的订单 */
	public void getNoDianPingOrders(Map<String, String> params, Map<String, Object> map, PageInfo page)
			throws Exception;

	/** 订单详情 */
	public void getOrderInfo(String titles, Map<String, Object> map);

	/** 取消订单 */
	public void cancelOrder(String titles, Map<String, Object> map);

	/** 取消原因 */
	public void cancelReason(CancelReasonPage cancelReasonPage, Map<String, Object> map);

	/** 确认收货 */
	public void confirmReceive(String titles, Map<String, Object> map);

	/** 订单物流状态-客户查看 */
	public void getOrderStatus(String u_id, String titles, Map<String, Object> map);

	/** 充值有礼页面初始化 */
	public void chargeWithGiftInit(Map<String, String> params, Map<String, Object> map);

	/** 充值有礼-确认订单 */
	public void chargeWithGiftConfirm(OrderConfirmPage orderConfirmPage, Map<String, Object> map) throws Exception;

	/** 积分商城订单页面初始化 */
	public void initPointsOrder(Map<String, String> params, Map<String, Object> map);

	/** 积分商城确认订单 */
	public void confirmPointsOrder(OrderConfirmPage orderConfirmPage, Map<String, Object> map) throws Exception;

	/** 取消的订单---如果付款--退款到余额 */
	public void refundPaymoneyByCancelOrder(ApiDingDan dingDan);

	/** 申请退货校验 */
	public boolean checkReturnGoods(String orderId, Map<String, Object> map);

	/********************** 商户端 **************************************************************************/
	/** 商铺端的订单 */
	public void getShopOrders(SearchOrdersPage searchOrdersPage, Map<String, Object> map) throws Exception;
	
	/** 商铺端的订单 (B2B不含020配送) */
	public void getShopOrderInfos(SearchOrdersPage searchOrdersPage, Map<String, Object> ret_map, PageInfo page) throws Exception;

	/** 催单 */
	public void getRemindOrder(SearchOrdersPage searchOrdersPage, Map<String, Object> map) throws Exception;

	/** 确认接单 */
	public void receiveOrder(ShopOrderPage shopOrderPage, Map<String, Object> map) throws Exception;

	/** 拒绝接单 */
	public void refuseOrder(ShopOrderPage shopOrderPage, Map<String, Object> map) throws Exception;

	/** 商铺端查询订单-搜索 */
	public void shopSearchOrders(SearchOrdersPage searchOrdersPage, Map<String, Object> map) throws Exception;

	/********************** 配送端 **************************************************************************/
	/** 配送端的订单 */
	public void getSendOrders(SearchOrdersPage searchOrdersPage, Map<String, Object> map) throws Exception;

	/** 配送员接单 */
	public void sendReceiveOrders(SendOrderPage sendOrderPage, Map<String, Object> map) throws Exception;

	/** 配送员查询订单-搜索 */
	public void sendSearchOrders(SearchOrdersPage searchOrdersPage, Map<String, Object> map) throws Exception;

	/** 配送端已到商家 */
	public void senderArriveShop(SendOrderPage sendOrderPage, Map<String, Object> map) throws Exception;

	/** 配送员取货成功 */
	public void senderTakeGoods(SendOrderPage sendOrderPage, Map<String, Object> map) throws Exception;

	/** 配送员货已送达 */
	public void sendGoodsOut(SendOrderPage sendOrderPage, Map<String, Object> map) throws Exception;

	public List<Map<String, Object>> backShopOrder(Cond cond);

	public void getMyOrderInfos(Map<String, String> params, Map<String, Object> map, PageInfo page);

	/** 用户的订单 (B2B不含020配送) */
	public void getMyAllOrderInfos(Map<String, String> params, Map<String, Object> ret_map, PageInfo page);

	public Integer getShopDingDanSize(HashMap map);

	public List<Map<String, Object>> getOrderListPage(Map<String, Object> conditions, PageInfo pageInfo);

	public List<AccountPage> searchMyBalanceListPage(HashMap map, PageInfo page);

	public ApiDingDan searchDingDanById(Integer c_id);

	public void updateApiDingDan(ApiDingDan apiDingDan);

	/** 订单详情 */
	public InitOrderInfoPage getOrderInfoObj(String titles);
	
	public String getProductIdsByOrderNum(String orderNum,List<String> productIds);
	
	public void updPlStatusByOrderNum(String orderNum);
	
	public Map<String,Object> getOrderInfoByOrderNum(String orderNum);
	
	
}
